<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		span {
			display: inline-block;
			width: 20px;
			height: 20px;
			line-height: 20px;
			text-align: center;
			color: red;
		}
	</style>
</head>
<body>
	
	<script>
		function pyramid() {

			for (var i=0; i<10; i++) {
				for (var k=0; k<10 - i - 1; k++) {
					document.write('<span></span>');
				}
				for (var j=0; j<=2*i; j++) {
					document.write('<span>*</span>');
				}
				document.write('<br>');
			}

		}

		pyramid();
	</script>
</body>
</html>